//package com.budwk.app.sqfwV2.generator.wasteCategory.pdf;
//
//import cn.hutool.core.date.DateUtil;
//import cn.hutool.core.text.StrFormatter;
//import com.budwk.app.sqfw.constants.CommonConstants;
//import com.budwk.app.sqfwDoc.codeGeneratorV2.fileParam.PdfGenerateParam;
//import com.budwk.app.sqfwDoc.codeGeneratorV2.generate.BasePdfGenerator;
//import com.budwk.app.sqfwV2.component.ProblemComponent;
//import com.budwk.app.sqfwV2.dto.dto.WasteCategoryNewPdfDTO;
//import com.budwk.app.util.poiUtils.SitePictureOfficeUtils;
//import com.google.common.collect.Lists;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.StringUtils;
//
//import java.util.List;
//import java.util.Map;
//
///**
// * 图片预览 生成pdf 2.0后操作
// */
//
//@Slf4j
//public class WastePictureGenerator extends BasePdfGenerator {
//
//    @Override
//    protected boolean pdfCreateConditionCheck(PdfGenerateParam pdfGenerateParam) {
//        return isGenerate(pdfGenerateParam);
//    }
//
//    // 檢查是否有隐患图片
//    private boolean isGenerate(PdfGenerateParam pdfGenerateParam) {
//        WasteCategoryNewPdfDTO pdfDTO = ProblemComponent.getPdfDTO(pdfGenerateParam.getAbstractCustomerPdfCreateField());
//        if (StringUtils.isNotEmpty(pdfDTO.getSitePhotos())) {
//            return true;
//        }
//        return false;
//    }
//
//
//    @Override
//    protected void customerPopularPdfParam(Map<String, Object> paramMap, PdfGenerateParam pdfGenerateParam) {
//        List<SitePictureOfficeUtils.SitePictureContent> sitePictureContentList = Lists.newArrayList();
//        WasteCategoryNewPdfDTO pdfDTO = ProblemComponent.getPdfDTO(pdfGenerateParam.getAbstractCustomerPdfCreateField());
//        String visitPictures = pdfDTO.getSitePhotos();
//        if (StringUtils.isNotBlank(visitPictures)) {
//            List<String> pictureList = Lists.newArrayList(Lists.newArrayList(visitPictures.split(",")));
//            String textStr = "附件：{} {} 现场照片";
//            textStr = StrFormatter.format(textStr, pdfDTO.getAddress(), DateUtil.format(pdfDTO.getFillDate(), "yyyy-MM-dd"));
//            sitePictureContentList.add(new SitePictureOfficeUtils.SitePictureContent(textStr, pictureList));
//        }
//        // 所有的整改图片
//        Map<String, Object> entityMap = SitePictureOfficeUtils.popularParamMap(sitePictureContentList);
//        if (entityMap != null) {
//            paramMap.putAll(entityMap);
//        }
//    }
//
//    @Override
//    protected String getTemplatePath(PdfGenerateParam pdfGenerateParam) {
//        return CommonConstants.PDF_NULL_TEMPLATE_PATH;
//    }
//}
